package hlkj.server;

import java.io.UnsupportedEncodingException;
import java.net.URLEncoder;
import java.util.Date;

import org.apache.commons.lang.StringUtils;

import com.jfinal.kit.PropKit;

import jxl.common.Logger;
import hlkj.util.ConnectionUrlUtil;
import hlkj.util.ServiceMsg;
import hlkj.util.ServiceMsg.SimplMsg;
import hlkj.util.main;
import lxycx.util.http.RequestPro;
import net.sf.json.JSONObject;

public class Xjxj_SMS extends SendOut{
	private static Logger log = Logger.getLogger(Xjxj_SMS.class);
	
	//发送短信
	public  String send_msg(String phone,String msg){
		return "短信接口尚未开发";
	}
	
	
	protected String getToken() {
		String url = "http://wt.189.cn/wx/cgi-bin/token";
		String res = ConnectionUrlUtil.sendPost(url, "grant_type=client_credential&appid=wxa3eb40e114f3d4c2&secret=c06e0c2d8157388c1b6d6a7e4a6bbf75");
		if(StringUtils.isNotBlank(res)) {
			JSONObject tokenStr = JSONObject.fromObject(res);
			String access_token = tokenStr.getString("access_token");
			return access_token;
		}
		return "";
	}
	
	
	public static void main(String[] args) {
		System.out.println(new Xjxj_SMS().getToken());
	}
	
	
	
}
